package com.felix.pattern.proxy;

import java.lang.reflect.Proxy;

/**
 * DynamicProxyTest
 *
 * @author xuejinhua
 * @date 2018/10/30 17:46
 */
public class DynamicProxyTest {

    public static void main(String[] args) {
        BuyHouseImpl buyHouse = new BuyHouseImpl();
        BuyHouse  proxyBuyHouse  = (BuyHouse) Proxy.newProxyInstance(BuyHouse.class.getClassLoader(), new Class[]{BuyHouse.class}, new DynamicProxyHandler(buyHouse));
        proxyBuyHouse.buyHouse();
    }
}
